package org.gitos.cloud.server.mq.logic;

import org.gitos.cloud.domain.mq.MqMsg;
import org.gitos.cloud.server.mq.PushManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

public class CommandHandler implements Runnable {

	private static final Logger log = LoggerFactory
			.getLogger(CommandHandler.class);
	@Autowired
	PushManager pushManager;

	private MqMsg msg;

	public MqMsg getMsg() {
		return msg;
	}

	public CommandHandler(MqMsg msg) {
		this.msg = msg;
	}

	@Override
	public void run() {
		pushManager.sendMsg(msg.getNodeId(), msg);
	}
}
